package com.zhaochao.example;


import com.zhaochao.validation.annotation.AssertTrueOn;
import com.zhaochao.validation.annotation.EnableCondition;
import com.zhaochao.validation.annotation.NotNullOn;
import jakarta.validation.constraints.NotNull;
import lombok.Data;


@Data
@EnableCondition
public class UserNotice {
    @NotNull(message = "通知类型不能为空 0-短信 1-邮件")
    private Integer noticeType;
    @NotNullOn(on = "#noticeType==0", message = "手机号码不能为空")
    private String userMobile;
    @NotNullOn(on = "#noticeType==1", message = "邮箱不能为空")
    private String userEmail;
    @AssertTrueOn(on = "#noticeType==0", message = "必须是男生")
    private Boolean isBoy;
}
